﻿CREATE VIEW dbo.VIEW_SEARCH_COST_PROTOCOL
AS
SELECT        dbo.COST_PROTOCOL.ID, dbo.COST_PROTOCOL.NUMBER, dbo.CONTRACT.NUMBER AS CONTRACT_NUMBER, 
                         dbo.NSI_ORGANIZATION.SHORT_NAME AS ORG_NAME, dbo.COST_PROTOCOL.IS_AGREED, dbo.COST_PROTOCOL.PID, dbo.COST_PROTOCOL.START_DATE, 
                         dbo.COST_PROTOCOL.END_DATE
FROM            dbo.CONTRACT LEFT OUTER JOIN
                         dbo.NSI_ORGANIZATION ON dbo.CONTRACT.NSI_ORGANIZATION_ID = dbo.NSI_ORGANIZATION.ID RIGHT OUTER JOIN
                         dbo.COST_PROTOCOL ON dbo.CONTRACT.PID = dbo.COST_PROTOCOL.PID